<?php

namespace App\Http\Controllers\Fee;
use App\helper\WebResp;
use App\Http\Bean\FeeLoglistBean;
use App\Http\Controllers\BaseController;
use App\Http\Po\FeeListItemPo;
use App\Http\Po\FeeListPo;
use App\Http\Po\FeeTypeItemPo;
use App\Services\FeeService;
use App\Traits\FillData;
use Illuminate\Support\Facades\Request;

class Index extends BaseController
{
    /**
     * @var FeeService
     */
    protected FeeService $service;
    public function __construct(FeeService $feeService)
    {
        $this->service = $feeService;
    }

    public function list(FeeLoglistBean $bean){
        $data = $this->service->getFeeLogList();
        $res = new FeeListPo($data->toArray());
        $res->list = FeeListItemPo::fromList($data->items());
        return WebResp::data($res);
    }

    public function type(){
        $data = $this->service->getFeeTypeList();
        $res = new FeeListPo($data->toArray());
        $res->list = FeeTypeItemPo::fromList($data->toArray());
        return \Resp::data($res);
    }

}
